<template>
    <div class="main_box" style="padding:10px">
        <div class="add_wrap add-detail_wrap">
            <el-form label-width="200px">
                <div class="tit">
                    <h2>基础信息</h2>
                    <el-button type="success" plain size="small" icon="fa fa-mail-forward" @click="returnList">返回
                    </el-button>
                </div>
                <el-row>
                    <el-form-item label="用户类型:">
                        <span>{{ formatUserType(dataInfo.userType) }}</span>
                    </el-form-item>
                    <el-form-item label="用户开户状态:">
                        <el-tag size="mini" effect="dark" :type="formatOpenStates(dataInfo.openState)">
                            {{ formatOpenState(dataInfo.openState) }}
                        </el-tag>
                    </el-form-item>
                    <el-form-item label="翼码用户ID:">
                        <span>{{ dataInfo.merchantId }}</span>
                    </el-form-item>
                    <el-form-item label="手机号:">
                        <span>{{ dataInfo.phone }}</span>
                    </el-form-item>
                    <el-form-item label="真实姓名:">
                        <span>{{ dataInfo.fullName }}</span>
                    </el-form-item>
                    <el-form-item label="身份证号:">
                        <span>{{ dataInfo.idCard }}</span>
                    </el-form-item>
                    <el-form-item label="身份证正面照:">
                        <el-image :src="dataInfo.idCardFront" fit="cover" :preview-src-list="[dataInfo.idCardFront]">

                        </el-image>
                    </el-form-item>
                    <el-form-item label="身份证反面照:">
                        <el-image :src="dataInfo.idCardBack" fit="cover" :preview-src-list="[dataInfo.idCardBack]">

                        </el-image>
                    </el-form-item>
                    <el-form-item label="创建人:">
                        <span>{{ dataInfo.createUserName }}</span>
                    </el-form-item>
                    <el-form-item label="创建时间:">
                        <span>{{ dataInfo.createDate }}</span>
                    </el-form-item>
                    <el-form-item label="修改人:">
                        <span>{{ dataInfo.modifyUserName }}</span>
                    </el-form-item>
                    <el-form-item label="修改时间:">
                        <span>{{ dataInfo.modifyDate }}</span>
                    </el-form-item>
                    <el-form-item label="备注:">
                        <span>{{ dataInfo.remark }}</span>
                    </el-form-item>
                </el-row>

                <div class="tit" v-if="dataInfo.userType!=3">
                    <h2>企业信息</h2>
                </div>
                <el-row v-if="dataInfo.userType!=3">
                    <el-form-item label="企业名称:">
                        <span>{{ dataInfo.businessName }}</span>
                    </el-form-item>
                    <el-form-item label="企业联系人姓名:">
                        <span>{{ dataInfo.linkName }}</span>
                    </el-form-item>
                    <el-form-item label="企业联系人电话:">
                        <span>{{ dataInfo.linkPhone }}</span>
                    </el-form-item>
                    <el-form-item label="企业营业执照:">
                        <el-image :src="dataInfo.businessLicense" fit="cover" :preview-src-list="[dataInfo.businessLicense]">

                        </el-image>
                    </el-form-item>
                </el-row>

                <div class="tit">
                    <h2>银行卡信息</h2>
                </div>
                <el-row>
                    <el-form-item label="银行卡类型:">
                        <span>{{ dataInfo.cardType==1?'对公':(dataInfo.userType==3?'对私个人':'对私法人') }}</span>
                    </el-form-item>
                    <el-form-item label="企业名称/法人姓名/个人姓名:">
                        <span>{{ dataInfo.cardName }}</span>
                    </el-form-item>
                    <el-form-item label="银行卡号:">
                        <span>{{ dataInfo.cardNo }}</span>
                    </el-form-item>
                    <el-form-item label="银行名称:">
                        <span>{{ dataInfo.bankName }}</span>
                    </el-form-item>
                    <el-form-item label="银行编号:">
                        <span>{{ dataInfo.bankCode }}</span>
                    </el-form-item>
                    <el-form-item label="银行支行名称:">
                        <span>{{ dataInfo.branchName }}</span>
                    </el-form-item>
                    <el-form-item label="银行支行编号:">
                        <span>{{ dataInfo.branchCode }}</span>
                    </el-form-item>
                    <el-form-item label="银行卡正面照:">
                        <el-image :src="dataInfo.bankCardFront" fit="cover" :preview-src-list="[dataInfo.bankCardFront]">

                        </el-image>
                    </el-form-item>
                    <el-form-item label="银行卡反面照:">
                        <el-image :src="dataInfo.bankCardBack" fit="cover" :preview-src-list="[dataInfo.bankCardBack]">

                        </el-image>
                    </el-form-item>
                </el-row>
            </el-form>
        </div>
    </div>
</template>

<script>
import YmAccountApi from '@/api/account/ymAccount';
export default {
    data() {
        return {
            dataInfo: {},
        };
    },
    computed: {

    },
    mounted() {
        this.getData()
    },
    methods: {
        getData() {
            YmAccountApi.getYmAccountInfo({ id: this.$route.query.id }).then(res => {
                this.dataInfo = res.data
            })
        },
        formatOpenStates(val) {
            switch (val) {
                case 1:
                    return ""
                case 2:
                    return "success"
                case 3:
                    return "danger"
            }
        },
        formatOpenState(val) {
            switch (val) {
                case 1:
                    return "开户审核中"
                case 2:
                    return "开户成功"
                case 3:
                    return "开户失败"
            }
        },
        formatUserType(val) {
            switch (val) {
                case 1:
                    return "企业商户"
                case 2:
                    return "个体工商户"
                case 3:
                    return "个人"

            }
        },
        returnList() {
            this.$store.dispatch('delView', this.$route);
            this.$router.push({ path: '/account/ymAccountManagement' })
        }
    },

}

</script>
<style lang="scss" scoped>
@import "@/assets/css/views/add.scss";
</style>
